import request from '@/utils/request'

export function updateAttrForSpu(spuId, list) {
  return request({
    url: `/api/goods/attr/update/${spuId}`,
    method: 'post',
    data: list
  })
}

export function listForSpu(spuId) {
  return request({
    url: `/api/goods/attr/base/listforspu/${spuId}`,
    method: 'get'
  })
}

export function list(query, id, attrType) {
  return request({
    url: `/api/goods/attr/${attrType}/list/${id}`,
    method: 'get',
    params: query
  })
}

export function info(id) {
  return request({
    url: `/api/goods/attr/info/${id}`,
    method: 'get',
    param: id
  })
}

export function add(list) {
  return request({
    url: '/api/goods/attr/save',
    method: 'post',
    data: list
  })
}

export function delMultiple(ids) {
  return request({
    url: '/api/goods/attr/delete',
    method: 'post',
    data: ids
  })
}

export function update(list) {
  return request({
    url: '/api/goods/attr/update',
    method: 'post',
    data: list
  })
}
